Replication material for

	Citizen Forecasting 2020: A State-by-State Experiment
	
	Andreas Murr, University of Warwick, a.murr@warwick.ac.uk
	Michael S. Lewis-Beck, University of Iowa, michael-lewis-beck@uiowa.edu

---------------------------------------------------------------

1) R code

The file "analysis.R" performs the analyses reported in the paper and supplementary material.  For the file and the corresponding output see the "log-file-analysis.pdf".

---------------------------------------------------------------

2) Codebook

-- Coding of parties and candidates

d = Democratic
i = independent
r = Republican

-- AnesInterestNationState.RData

year = election year
state = state
interest = political interest
forecast.state = citizen forecast of state
forecast.nation = citizen forecast of nation

-- AnesNation.Rdata

year = election year
elected = winning party of election
pop.dem = Democratic two-party popular vote share 
ele.dem = Democratic two-party electoral vote share 
pop.inc = incumbent two-party popular vote share 
ele.dem = incumbent two-party electoral vote share 
p.dem = proportion of respondents who say that Democratic candidate will win 
n = number of survey respondents
p.inc = proportion of respondents who say that the candidate of the incumbent party will win 
forecast = party of the candidate that most citizens say will win

-- AnesState.RData

year = election year
state = state
electoralv = electoral votes
winner = party of winning candidate
dem.two.s = Democratic two-party popular vote share
p.dem = proportion of respondents who say that Democratic candidate will win
n = number of survey respondents
forecast = party of the candidate that most citizens say will win

-- MturkInterestNationState.RData

state = state
interest = political interest
forecast.nation = citizen forecast of state
forecast.state = citizen forecast of state

-- MturkNation3.RData

year = election year
p.dem = proportion of respondents who say that Democratic candidate will win
n = number of survey respondents
forecast = party of the candidate that most citizens say will win

-- MturkState3.Rdata

year = election year
state = state
electoralv = electoral votes
winner = party of winning candidate
dem.two.s = Democratic two-party popular vote share
p.dem = proportion of respondents who say that Democratic candidate will win
n = number of survey respondents
forecast = party of the candidate that most citizens say will win

-- PresidentialElectionResultByState1948to2016.csv

year = election year
state = state
electoralv = electoral votes
winner = party who won
dem = number of democratic votes
ind = number of independent votes
oth = number of other votes
rep = number of republican votes
tot = total number of votes

-- PresidentialElectionResultsNation1948to2016.csv

year = election year
elected = party of elected candidate
evote.d = share of electoral vote for democrats (in %)
evote.r = share of electoral vote for republicans (in %)
evote.o = share of electoral vote for others (in %)
pvote.d = share of popular vote for democrats (in %)
pvote.r = share of popular vote for republicans (in %)
pvote.o = share of popular vote for others (in %)
incumbent = party of incumbent president

---------------------------------------------------------------

3) Information to reconstruct the analysis data sets

The folder "data-and-code-to-reconstruct-the-analysis-data-sets" contains the R code needed to reconstruct the analysis data sets as well as one of two of the data sets relevant for the reconstruction.

The code file

-- "prepare-anes-interest-nation-state-data-set.R" creates "AnesInterestNationState.RData",
-- "prepare-anes-national-data.R" creates "AnesNation.RData", and
-- "prepare-anes-state-data.R" creates "AnesState.RData".

To run the code, the following files of the American National Election Study need to be acquired in addition:

-- ANES Time Series Cumulative Data File 1948--2008, American National Election Studies, August 25, 2011
-- ANES 2012 Time Series Study, American National Election Studies, June 13, 2013
-- ANES 2016 Time Series Study, American National Election Studies, September 4, 2019

4) Map

The file "ElectoralCollege2020-survey-ps.svg" contains the electoral map.

The file "Legend-ps.svg" contains the legend.

The svg files were adapted from https://en.wikipedia.org/wiki/File:ElectoralCollege2012.svg